﻿using Bricks.Business.Models.Account;
using Bricks.Component.Utils;
using Bricks.Site.Models.Purview;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bricks.Business.Service
{
    /// <summary>
    /// 菜单模块核心业务契约
    /// </summary>
    public interface IMenuInfoService
    {
        /// <summary>
        /// 获取 菜单信息查询数据集
        /// </summary>
        IQueryable<MenuInfo> Menues { get; }

        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        OperationResult Add(MenuInfo model);

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        OperationResult Modify(MenuInfo model);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        OperationResult Delete(Guid id);

        /// <summary>
        /// 排序设置(向上向下)
        /// </summary>
        /// <param name="id"></param>
        /// <param name="pid"></param>
        /// <param name="upOrDown"></param>
        /// <returns></returns>
        OperationResult SetOrder(Guid id, Guid? pid, string upOrDown);

        /// <summary>
        /// 获取菜单功能列表
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        IQueryable<MenuAction> GetMenuActionList(Guid id);

        /// <summary>
        /// 保存功能分配
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        OperationResult SaveAssign(Guid menuID, List<MenuActionAssignView> list);

        /// <summary>
        /// 根据ID获取菜单的信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        MenuInfo GetMenuInfo(Guid id);

        /// <summary>
        /// 获取模块和菜单名称
        /// Tuple1：模块名称
        /// Tuple2：菜单名称
        /// </summary>
        /// <param name="tag"></param>
        /// <returns></returns>
        string GetModelAndMenuName(string tag);
    }
}
